<template>
  <div class="mui-numbox" data-numbox-min='1' data-numbox-step='1' >
		<button class="mui-btn mui-btn-numbox-minus" type="button" >-</button>
		<input class="mui-input-numbox" type="number" ref='changing' @change="changed" max=/>
		<button class="mui-btn mui-btn-numbox-plus" type="button">+</button>
	</div>
</template>
<script>
import mui from "../../lib/mui/js/mui.min.js";

export default {
  mounted(){
    mui('.mui-numbox').numbox()
  },
  data(){
    return {

    }
  },
  props:['max'],
  methods:{
    //获取购物车的那个数据
    changed(){
      this.$emit('get',parseInt(this.$refs.changing.value))
    }
  },
  watch:{
    max:(newVal,oldVal)=>{
      mui(".mui-numbox")
        .numbox()
        .setOption("max", newVal);
    }
   
  }
}
</script>
<style lang="">
  
</style>